package demo1;

//牛客网:删除公共字符串

import java.util.*;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        Set<Character> set = new HashSet<>();
        String s1 = in.nextLine();
        String s2 = in.nextLine();
        for(int i = 0; i<s2.length(); i++) {
            set.add(s2.charAt(i));
        }
        StringBuffer ret = new StringBuffer();
        for(int i =0; i<s1.length(); i++) {
            char ch = s1.charAt(i);
            if(!set.contains(ch)) {
                ret.append(ch);
            }
        }
        System.out.println(ret);
    }
}